Skip to content

Conversation

@oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Jan 24, 2025

cc #135996

@rustbot

This comment was marked as outdated.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jan 24, 2025
@oli-obk oli-obk added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 24, 2025
@rust-log-analyzer

This comment has been minimized.

Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well r=me when/if it does get unblocked.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Jan 27, 2025

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@Veykril
Copy link
Member

Veykril commented Jan 27, 2025

Re rust-analyzer blocker, as it turns out to implement pattern types (to a degree that would unblock this) it comes down to the same architecture changes required as for rust-lang/rust-analyzer#7434 (which I am currently looking into), so that will take a bit.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Jan 27, 2025

Some changes occurred to the CTFE machinery

cc @rust-lang/wg-const-eval

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Aug 3, 2025

☔ The latest upstream changes (presumably #144814) made this pull request unmergeable. Please resolve the merge conflicts.

@rustbot rustbot added the T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. label Sep 23, 2025
@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Sep 25, 2025
Add proper name mangling for pattern types

requires adding demangler support first rust-lang/rustc-demangle#81

needed for rust-lang#136006 (comment) as otherwise we will have symbol collisions
rust-timer added a commit that referenced this pull request Sep 25, 2025
Rollup merge of #142401 - oli-obk:pattern-mango, r=petrochenkov

Add proper name mangling for pattern types

requires adding demangler support first rust-lang/rustc-demangle#81

needed for #136006 (comment) as otherwise we will have symbol collisions
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Sep 26, 2025
Add proper name mangling for pattern types

requires adding demangler support first rust-lang/rustc-demangle#81

needed for rust-lang/rust#136006 (comment) as otherwise we will have symbol collisions
@bors
Copy link
Collaborator

bors commented Oct 3, 2025

☔ The latest upstream changes (presumably #142771) made this pull request unmergeable. Please resolve the merge conflicts.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 22, 2025
…BoxyUwU

Add NonNull pattern types

These are the final piece missing for

* rust-lang#136006

We cannot use the previous scheme of using an integer range for raw pointers, as we're not just changing the layout of raw pointers anymore, but also the type representation. And we can't represent "any provenance or NonZero<usize>" natively as patterns. So I created a new `!null` pattern. Since this is all unstable representation stuff for replacing rustc_layout_scalar_range_start with pattern types, the divergence from normal patterns is fine, especially since T-lang seems interested in exploring general negation patterns

r? `@BoxyUwU`
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Oct 23, 2025
Add NonNull pattern types

These are the final piece missing for

* rust-lang/rust#136006

We cannot use the previous scheme of using an integer range for raw pointers, as we're not just changing the layout of raw pointers anymore, but also the type representation. And we can't represent "any provenance or NonZero<usize>" natively as patterns. So I created a new `!null` pattern. Since this is all unstable representation stuff for replacing rustc_layout_scalar_range_start with pattern types, the divergence from normal patterns is fine, especially since T-lang seems interested in exploring general negation patterns

r? `@BoxyUwU`
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Oct 27, 2025
Add NonNull pattern types

These are the final piece missing for

* rust-lang/rust#136006

We cannot use the previous scheme of using an integer range for raw pointers, as we're not just changing the layout of raw pointers anymore, but also the type representation. And we can't represent "any provenance or NonZero<usize>" natively as patterns. So I created a new `!null` pattern. Since this is all unstable representation stuff for replacing rustc_layout_scalar_range_start with pattern types, the divergence from normal patterns is fine, especially since T-lang seems interested in exploring general negation patterns

r? `@BoxyUwU`
@rustbot
Copy link
Collaborator

rustbot commented Oct 28, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@oli-obk oli-obk removed the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Oct 28, 2025
@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Oct 28, 2025

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo, @GuillaumeGomez

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

Use `!null` pattern type in libcore
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-gcc failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test [mir-opt] tests/mir-opt/unusual_item_types.rs ... ok

failures:

---- [mir-opt] tests/mir-opt/pre-codegen/loops.rs stdout ----
3 fn vec_move(_1: Vec<impl Sized>) -> () {
4     debug v => _1;
5     let mut _0: ();
-     let mut _21: std::vec::IntoIter<impl Sized>;
7     let mut _22: std::vec::IntoIter<impl Sized>;
-     let mut _23: &mut std::vec::IntoIter<impl Sized>;
-     let mut _24: std::option::Option<impl Sized>;
-     let mut _25: isize;
-     let _27: ();
+     let mut _23: std::vec::IntoIter<impl Sized>;
+     let mut _24: &mut std::vec::IntoIter<impl Sized>;
+     let mut _25: std::option::Option<impl Sized>;
+     let mut _26: isize;
+     let _28: ();
12     scope 1 {
-         debug iter => _22;
-         let _26: impl Sized;
+         debug iter => _23;
+         let _27: impl Sized;
15         scope 2 {
-             debug x => _26;
+             debug x => _27;
17         }
18     }
19     scope 3 (inlined <Vec<impl Sized> as IntoIterator>::into_iter) {

24         let mut _10: *mut impl Sized;
25         let mut _11: *const impl Sized;
26         let mut _12: usize;
-         let _28: &std::vec::Vec<impl Sized>;
-         let mut _29: &std::mem::ManuallyDrop<std::vec::Vec<impl Sized>>;
-         let mut _30: &alloc::raw_vec::RawVec<impl Sized>;
-         let mut _31: &std::mem::ManuallyDrop<std::vec::Vec<impl Sized>>;
-         let _32: &std::vec::Vec<impl Sized>;
-         let mut _33: &std::mem::ManuallyDrop<std::vec::Vec<impl Sized>>;
-         let _34: &std::vec::Vec<impl Sized>;
-         let mut _35: &std::mem::ManuallyDrop<std::vec::Vec<impl Sized>>;
-         let mut _36: &alloc::raw_vec::RawVec<impl Sized>;
-         let mut _37: &std::mem::ManuallyDrop<std::vec::Vec<impl Sized>>;
+         let _29: &std::vec::Vec<impl Sized>;
+         let mut _30: &std::mem::ManuallyDrop<std::vec::Vec<impl Sized>>;
+         let mut _31: &alloc::raw_vec::RawVec<impl Sized>;
+         let mut _32: &std::mem::ManuallyDrop<std::vec::Vec<impl Sized>>;
+         let _33: &std::vec::Vec<impl Sized>;
+         let mut _34: &std::mem::ManuallyDrop<std::vec::Vec<impl Sized>>;
+         let _35: &std::vec::Vec<impl Sized>;
+         let mut _36: &std::mem::ManuallyDrop<std::vec::Vec<impl Sized>>;
+         let mut _37: &alloc::raw_vec::RawVec<impl Sized>;
+         let mut _38: &std::mem::ManuallyDrop<std::vec::Vec<impl Sized>>;
37         scope 4 {
38             debug me => _2;
39             scope 5 {

46                         debug begin => _7;
47                         scope 8 {
48                             debug end => _11;
-                             let _19: usize;
+                             let _20: usize;
50                             scope 9 {
-                                 debug cap => _19;
+                                 debug cap => _20;
52                             }
53                             scope 39 (inlined <ManuallyDrop<Vec<impl Sized>> as Deref>::deref) {
-                                 debug self => _37;
+                                 debug self => _38;
55                             }
56                             scope 40 (inlined alloc::raw_vec::RawVec::<impl Sized>::capacity) {
-                                 debug self => _36;
-                                 let mut _38: &alloc::raw_vec::RawVecInner;
+                                 debug self => _37;
+                                 let mut _39: &alloc::raw_vec::RawVecInner;
59                                 scope 41 (inlined std::mem::size_of::<impl Sized>) {
60                                 }
61                                 scope 42 (inlined alloc::raw_vec::RawVecInner::capacity) {

-                                     debug self => _38;
+                                     debug self => _39;
63                                     debug elem_size => const <impl Sized as std::mem::SizedTypeProperties>::SIZE;
-                                     let mut _20: core::num::niche_types::UsizeNoHighBit;
+                                     let mut _21: (usize) is 0..=9223372036854775807;
65                                     scope 43 (inlined core::num::niche_types::UsizeNoHighBit::as_inner) {
-                                         debug self => _20;
+                                         debug ((self: core::num::niche_types::UsizeNoHighBit).0: (usize) is 0..=9223372036854775807) => _21;
67                                     }
68                                 }
69                             }

70                         }
71                         scope 25 (inlined <ManuallyDrop<Vec<impl Sized>> as Deref>::deref) {
-                             debug self => _33;
+                             debug self => _34;
73                         }
74                         scope 26 (inlined Vec::<impl Sized>::len) {
-                             debug self => _32;
+                             debug self => _33;
76                             let mut _13: bool;
77                             scope 27 {
78                             }

82                             debug count => _12;
---
86                                 debug self => _7;
87                             }

98                             }
99                             scope 32 (inlined std::ptr::mut_ptr::<impl *mut u8>::with_metadata_of::<impl Sized>) {
100                                 debug self => _18;
-                                 debug meta => _5;
+                                 debug meta => _19;
102                                 scope 33 (inlined std::ptr::metadata::<impl Sized>) {
-                                     debug ptr => _5;
+                                     debug ptr => _19;
104                                 }
105                                 scope 34 (inlined std::ptr::from_raw_parts_mut::<impl Sized, ()>) {
106                                 }

107                             }
108                         }
109                         scope 35 (inlined <ManuallyDrop<Vec<impl Sized>> as Deref>::deref) {
-                             debug self => _35;
+                             debug self => _36;
111                         }
112                         scope 36 (inlined Vec::<impl Sized>::len) {
-                             debug self => _34;
+                             debug self => _35;
114                             let mut _9: bool;
115                             scope 37 {
116                             }

125                     }
126                 }
127                 scope 17 (inlined <ManuallyDrop<Vec<impl Sized>> as Deref>::deref) {
-                     debug self => _31;
+                     debug self => _32;
129                 }
130                 scope 18 (inlined alloc::raw_vec::RawVec::<impl Sized>::non_null) {
-                     debug self => _30;
+                     debug self => _31;
132                     scope 19 (inlined alloc::raw_vec::RawVecInner::non_null::<impl Sized>) {
133                         let mut _4: std::ptr::NonNull<u8>;
134                         scope 20 (inlined Unique::<u8>::cast::<impl Sized>) {

135                             scope 21 (inlined NonNull::<u8>::cast::<impl Sized>) {
-                                 let mut _5: *const impl Sized;
+                                 let mut _5: (*const impl Sized) is !null;
137                                 scope 22 (inlined NonNull::<u8>::as_ptr) {
138                                 }
139                             }

144                 }
145             }
146             scope 11 (inlined <ManuallyDrop<Vec<impl Sized>> as Deref>::deref) {
-                 debug self => _29;
+                 debug self => _30;
148             }
149             scope 12 (inlined Vec::<impl Sized>::allocator) {
-                 debug self => _28;
+                 debug self => _29;
151                 scope 13 (inlined alloc::raw_vec::RawVec::<impl Sized>::allocator) {
152                     scope 14 (inlined alloc::raw_vec::RawVecInner::allocator) {
153                     }

166     }
167 
168     bb0: {
---
174         StorageLive(_5);
-         StorageLive(_4);
176         StorageLive(_17);
177         StorageLive(_2);
178         _2 = ManuallyDrop::<Vec<impl Sized>> { value: copy _1 };

179         StorageLive(_3);
-         // DBG: _29 = &_2;
-         // DBG: _28 = &(_2.0: std::vec::Vec<impl Sized>);
+         // DBG: _30 = &_2;
+         // DBG: _29 = &(_2.0: std::vec::Vec<impl Sized>);
182         _3 = &raw const ((((_2.0: std::vec::Vec<impl Sized>).0: alloc::raw_vec::RawVec<impl Sized>).0: alloc::raw_vec::RawVecInner).2: std::alloc::Global);
183         StorageDead(_3);
-         // DBG: _31 = &_2;
-         // DBG: _30 = &((_2.0: std::vec::Vec<impl Sized>).0: alloc::raw_vec::RawVec<impl Sized>);
+         // DBG: _32 = &_2;
+         // DBG: _31 = &((_2.0: std::vec::Vec<impl Sized>).0: alloc::raw_vec::RawVec<impl Sized>);
+         StorageLive(_4);
186         _4 = copy (((((_2.0: std::vec::Vec<impl Sized>).0: alloc::raw_vec::RawVec<impl Sized>).0: alloc::raw_vec::RawVecInner).0: std::ptr::Unique<u8>).0: std::ptr::NonNull<u8>);
-         _5 = copy _4 as *const impl Sized (Transmute);
+         _5 = copy _4 as (*const impl Sized) is !null (Transmute);
188         _6 = NonNull::<impl Sized> { pointer: copy _5 };
-         _7 = copy _4 as *mut impl Sized (Transmute);
+         StorageDead(_4);
+         _7 = copy _5 as *mut impl Sized (Transmute);
190         switchInt(const <impl Sized as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb1, otherwise: bb2];
191     }
192 

193     bb1: {
194         StorageLive(_10);
195         StorageLive(_8);
-         // DBG: _35 = &_2;
-         // DBG: _34 = &(_2.0: std::vec::Vec<impl Sized>);
+         // DBG: _36 = &_2;
+         // DBG: _35 = &(_2.0: std::vec::Vec<impl Sized>);
198         _8 = copy ((_2.0: std::vec::Vec<impl Sized>).1: usize);
199         StorageLive(_9);
200         _9 = Le(copy _8, const <impl Sized as std::mem::SizedTypeProperties>::MAX_SLICE_LEN);

209 
210     bb2: {
211         StorageLive(_12);
-         // DBG: _33 = &_2;
-         // DBG: _32 = &(_2.0: std::vec::Vec<impl Sized>);
+         // DBG: _34 = &_2;
+         // DBG: _33 = &(_2.0: std::vec::Vec<impl Sized>);
214         _12 = copy ((_2.0: std::vec::Vec<impl Sized>).1: usize);
215         StorageLive(_13);
216         _13 = Le(copy _12, const <impl Sized as std::mem::SizedTypeProperties>::MAX_SLICE_LEN);

218         StorageDead(_13);
219         StorageLive(_18);
220         StorageLive(_14);
-         _14 = copy _4 as *mut u8 (Transmute);
+         _14 = copy _5 as *mut u8 (Transmute);
222         StorageLive(_15);
223         _15 = copy _12 as isize (IntToInt);
224         StorageLive(_16);

-         _16 = copy _4 as *const u8 (Transmute);
+         _16 = copy _5 as *const u8 (Transmute);
226         _17 = arith_offset::<u8>(move _16, move _15) -> [return: bb3, unwind unreachable];
227     }
228 

231         _18 = copy _17 as *mut u8 (PtrToPtr);
232         StorageDead(_15);
233         StorageDead(_14);
+         StorageLive(_19);
+         _19 = copy _5 as *const impl Sized (Transmute);
+         StorageDead(_19);
234         StorageDead(_18);
235         StorageDead(_12);
236         _11 = copy _17 as *const impl Sized (PtrToPtr);

238     }
239 
240     bb4: {
-         // DBG: _37 = &_2;
-         // DBG: _36 = &((_2.0: std::vec::Vec<impl Sized>).0: alloc::raw_vec::RawVec<impl Sized>);
-         // DBG: _38 = &(((_2.0: std::vec::Vec<impl Sized>).0: alloc::raw_vec::RawVec<impl Sized>).0: alloc::raw_vec::RawVecInner);
+         // DBG: _38 = &_2;
+         // DBG: _37 = &((_2.0: std::vec::Vec<impl Sized>).0: alloc::raw_vec::RawVec<impl Sized>);
+         // DBG: _39 = &(((_2.0: std::vec::Vec<impl Sized>).0: alloc::raw_vec::RawVec<impl Sized>).0: alloc::raw_vec::RawVecInner);
+         StorageLive(_21);
244         switchInt(const <impl Sized as std::mem::SizedTypeProperties>::SIZE) -> [0: bb5, otherwise: bb6];
245     }
246 

247     bb5: {
-         _19 = const usize::MAX;
+         _20 = const usize::MAX;
249         goto -> bb7;
250     }
251 

252     bb6: {
-         StorageLive(_20);
-         _20 = copy ((((_2.0: std::vec::Vec<impl Sized>).0: alloc::raw_vec::RawVec<impl Sized>).0: alloc::raw_vec::RawVecInner).1: core::num::niche_types::UsizeNoHighBit);
-         _19 = copy _20 as usize (Transmute);
-         StorageDead(_20);
+         _21 = copy (((((_2.0: std::vec::Vec<impl Sized>).0: alloc::raw_vec::RawVec<impl Sized>).0: alloc::raw_vec::RawVecInner).1: core::num::niche_types::UsizeNoHighBit).0: (usize) is 0..=9223372036854775807);
+         _20 = copy _21 as usize (Transmute);
257         goto -> bb7;
258     }
259 

260     bb7: {
-         _21 = std::vec::IntoIter::<impl Sized> { buf: copy _6, phantom: const ZeroSized: PhantomData<impl Sized>, cap: move _19, alloc: const ManuallyDrop::<std::alloc::Global> {{ value: std::alloc::Global }}, ptr: copy _6, end: copy _11 };
+         StorageDead(_21);
+         _22 = std::vec::IntoIter::<impl Sized> { buf: copy _6, phantom: const ZeroSized: PhantomData<impl Sized>, cap: move _20, alloc: const ManuallyDrop::<std::alloc::Global> {{ value: std::alloc::Global }}, ptr: copy _6, end: copy _11 };
262         StorageDead(_2);
263         StorageDead(_17);
-         StorageDead(_4);
265         StorageDead(_5);
-         StorageDead(_19);
---
274 

275     bb8: {
-         StorageLive(_24);
-         _23 = &mut _22;
-         _24 = <std::vec::IntoIter<impl Sized> as Iterator>::next(move _23) -> [return: bb9, unwind: bb15];
+         StorageLive(_25);
+         _24 = &mut _23;
+         _25 = <std::vec::IntoIter<impl Sized> as Iterator>::next(move _24) -> [return: bb9, unwind: bb15];
279     }
280 
281     bb9: {

-         _25 = discriminant(_24);
-         switchInt(move _25) -> [0: bb10, 1: bb12, otherwise: bb14];
+         _26 = discriminant(_25);
+         switchInt(move _26) -> [0: bb10, 1: bb12, otherwise: bb14];
284     }
285 
286     bb10: {

-         StorageDead(_24);
-         drop(_22) -> [return: bb11, unwind continue];
+         StorageDead(_25);
+         drop(_23) -> [return: bb11, unwind continue];
289     }
290 
291     bb11: {

+         StorageDead(_23);
292         StorageDead(_22);
-         StorageDead(_21);
294         return;
295     }
296 

297     bb12: {
-         _26 = move ((_24 as Some).0: impl Sized);
-         _27 = opaque::<impl Sized>(move _26) -> [return: bb13, unwind: bb15];
+         _27 = move ((_25 as Some).0: impl Sized);
+         _28 = opaque::<impl Sized>(move _27) -> [return: bb13, unwind: bb15];
300     }
301 
302     bb13: {

-         StorageDead(_24);
+         StorageDead(_25);
304         goto -> bb8;
305     }
306 

309     }
310 
311     bb15 (cleanup): {
-         drop(_22) -> [return: bb16, unwind terminate(cleanup)];
+         drop(_23) -> [return: bb16, unwind terminate(cleanup)];
313     }
314 
315     bb16 (cleanup): {


thread '[mir-opt] tests/mir-opt/pre-codegen/loops.rs' panicked at src/tools/compiletest/src/runtest/mir_opt.rs:84:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/pre-codegen/loops.vec_move.PreCodegen.after.mir
stack backtrace:
   5: __rustc::rust_begin_unwind
             at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f/library/std/src/panicking.rs:698:5
   6: core::panicking::panic_fmt
             at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f/library/core/src/panicking.rs:80:14
   7: <compiletest::runtest::TestCx>::run_revision
   8: compiletest::runtest::run
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---- [mir-opt] tests/mir-opt/pre-codegen/loops.rs stdout end ----
---- [mir-opt] tests/mir-opt/pre-codegen/slice_iter.rs stdout ----
37                     }
38                 }
39                 scope 14 (inlined NonNull::<T>::add) {
-                     let mut _8: *const T;
-                     let mut _9: *const T;
+                     let mut _8: *mut T;
+                     let mut _9: (*const T) is !null;
42                     scope 15 (inlined NonNull::<T>::as_ptr) {
43                     }
44                 }

60         StorageLive(_12);
61         StorageLive(_4);
62         StorageLive(_14);
+         StorageLive(_5);
63         _2 = copy ((*_1).0: std::ptr::NonNull<T>);
64         _3 = copy ((*_1).1: *const T);
65         switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb1, otherwise: bb4];

68     bb1: {
69         StorageLive(_7);
70         _4 = copy _3 as std::ptr::NonNull<T> (Transmute);
-         StorageLive(_5);
72         _5 = copy _2 as *mut T (Transmute);
73         StorageLive(_6);
74         _6 = copy _4 as *mut T (Transmute);

75         _7 = Eq(copy _5, copy _6);
76         StorageDead(_6);
-         StorageDead(_5);
78         switchInt(move _7) -> [0: bb2, otherwise: bb3];
79     }
80 

83         StorageLive(_10);
84         StorageLive(_9);
85         StorageLive(_8);
-         _8 = copy _2 as *const T (Transmute);
-         _9 = Offset(copy _8, const 1_usize);
+         _8 = Offset(copy _5, const 1_usize);
+         _9 = copy _8 as (*const T) is !null (Transmute);
88         StorageDead(_8);
-         _10 = NonNull::<T> { pointer: copy _9 };
+         _10 = NonNull::<T> { pointer: move _9 };
90         StorageDead(_9);
91         ((*_1).0: std::ptr::NonNull<T>) = move _10;
92         StorageDead(_10);

125     }
126 
127     bb8: {
+         StorageDead(_5);
128         StorageDead(_14);
129         StorageDead(_4);
130         StorageDead(_12);


thread '[mir-opt] tests/mir-opt/pre-codegen/slice_iter.rs' panicked at src/tools/compiletest/src/runtest/mir_opt.rs:84:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/pre-codegen/slice_iter.slice_iter_next.PreCodegen.after.panic-unwind.mir
stack backtrace:
   5: __rustc::rust_begin_unwind
             at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f/library/std/src/panicking.rs:698:5
   6: core::panicking::panic_fmt
             at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f/library/core/src/panicking.rs:80:14

For more information how to resolve CI failures of this job, visit this link.

Comment on lines +672 to -689

let kind = match parent_ty.ty.kind() {
&ty::Alias(ty::Opaque, ty::AliasTy { def_id, args, .. }) => {
self.tcx.type_of(def_id).instantiate(self.tcx, args).kind()
}
kind => kind,
};

let check_equal = |this: &mut Self, location, f_ty| {
if !this.mir_assign_valid_types(ty, f_ty) {
this.fail(
location,
format!(
"Field projection `{place_ref:?}.{f:?}` specified type `{ty}`, but actual type is `{f_ty}`"
"Field projection `{place_ref:?}.{f:?}` specified type `{ty}`, but actual field type of `{kind:?}` is `{f_ty}`"
)
)
}
};

let kind = match parent_ty.ty.kind() {
&ty::Alias(ty::Opaque, ty::AliasTy { def_id, args, .. }) => {
self.tcx.type_of(def_id).instantiate(self.tcx, args).kind()
}
kind => kind,
};

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a driveby debugging change

Comment on lines +92 to +95
_10 = copy _9 as (*const u8) is !null (Transmute);
StorageDead(_9);
StorageLive(_11);
_11 = copy _10 as *mut u8 (Transmute);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we lose some GVN for now, could try to first fix this without changing libstd

#[no_mangle]
pub fn load_box<'a>(x: Box<Box<i32>>) -> Box<i32> {
// CHECK: load ptr, ptr %{{.*}}, align [[PTR_ALIGNMENT]], !nonnull !{{[0-9]+}}, !align ![[ALIGN_4_META]], !noundef !{{[0-9]+}}
// CHECK: load ptr, ptr %{{.*}}, align [[PTR_ALIGNMENT]], !nonnull !{{[0-9]+}}, !noundef !{{[0-9]+}}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to investigate what made us lose this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. O-unix Operating system: Unix-like O-wasi Operating system: Wasi, Webassembly System Interface O-wasm Target: WASM (WebAssembly), http://webassembly.org/ T-clippy Relevant to the Clippy team. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.